/**
 * 
 */
package server;

	import java.util.LinkedList;
	
	import abstractions.CommandC;
	import abstractions.Doc;
	import abstractions.LoggedUser;
	import abstractions.OpenDoc;
	import abstractions.User;


/**
 * @author rdru
 * INV: 
 */
public class ActiveDoc extends OpenDoc {	// used by the Server
	public LinkedList<CommandC>			histNew;
	
	public ActiveDoc(Doc d, String text) {
		super(d, text); 
		this.histNew = new LinkedList<CommandC>();
	}
	
	public synchronized void sendUpdates() {
		for (int u: editedBy) {
			LoggedUser l = Server.loggedUsers.get(u);
			Server.updateDoc(l.clientId, l.id, id, histNew);
		}
	}
}
